/**
 * 
 */
package com.thor.palmmall.rest.todo.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.todo.ATaskQueryCount;
import com.thor.palmmall.spi.todo.STaskQueryCount;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class ATaskQueryCountConverter implements Converter<STaskQueryCount, ATaskQueryCount> {

  public static ATaskQueryCountConverter getInstance() {
    if (instance == null)
      instance = new ATaskQueryCountConverter();
    return instance;
  }

  private static ATaskQueryCountConverter instance;

  private ATaskQueryCountConverter() {
  }

  @Override
  public ATaskQueryCount convert(STaskQueryCount source) {
    if (source == null) {
      return null;
    }
    ATaskQueryCount target = new ATaskQueryCount();
    target.setCount(source.getCount());
    target.setDefinitionKey(source.getDefinitionKey());
    target.setDefinitionName(source.getDefinitionName());
    return target;
  }

}
